package com.ftg.learn.smhtml.qianduan.contorller;

import com.ftg.learn.smhtml.qianduan.pojo.Xiaoxi;
import com.ftg.learn.smhtml.qianduan.service.XiaoxiService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;


@RestController
@CrossOrigin
@RequestMapping("/news")

public class XiaoxiContorller {

    @Autowired
    XiaoxiService xs;

    @GetMapping("/shownews")
    public List<Xiaoxi> showall(){
        return xs.showAll();

    }
}
